package com.smartleanx.module.hrm.controller.admin.esign;

import com.alibaba.fastjson2.JSONObject;
import com.smartleanx.framework.common.pojo.CommonResult;
import com.smartleanx.framework.tenant.core.aop.TenantIgnore;
import com.smartleanx.module.hrm.service.esign.service.ContractPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.security.PermitAll;

@RestController
@RequestMapping("/hrm/contractPackage")
public class ContractPackageController {

    @Autowired
    private ContractPackageService contractPackageService;

    @PostMapping("/insert")
    @PermitAll
    @TenantIgnore
    public JSONObject insert(@RequestBody JSONObject param) {
        Integer insert = contractPackageService.insert(param);
        JSONObject result = new JSONObject();
        result.put("data", insert);
        return result;
    }

    @GetMapping("/select")
    @PermitAll
    @TenantIgnore
    public JSONObject select() {
        JSONObject select = contractPackageService.select();
        JSONObject result = new JSONObject();
        result.put("data", select);
        return result;
    }


    @GetMapping("/selectOrderStatus")
    public CommonResult<Object> selectOrderStatus(@RequestParam("orderSn") String orderSn) {
        Integer i = contractPackageService.selectOrderStatus(orderSn);
        return CommonResult.success(i);
    }
}
